﻿<UserControl x:Class="G19Glower.Glowies.LinearGlowerSettings"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        mc:Ignorable="d" d:DesignHeight="314" d:DesignWidth="363">
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <TabControl Margin="3,3,3,0">
            <TabItem Header="Colour">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                
                    <Rectangle Grid.Column="1" Grid.RowSpan="2" Margin="9" Width="27" Stroke="Black" StrokeThickness="2">
                        <Rectangle.Fill>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                <GradientStop x:Name="EndGradientStop" Offset="0">
                                </GradientStop>
                                <GradientStop x:Name="StartGradientStop" Offset="1">
                                </GradientStop>
                            </LinearGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>

                    <GroupBox Header="Glow Colour">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <Label Content="Red" />
                            <Label Content="Green" Grid.Row="1" />
                            <Label Content="Blue" Grid.Row="2" />

                            <Slider x:Name="EndRedSlider"
                                    Grid.Column="1"
                                    Maximum="255" Minimum="0" Margin="3" 
                                    ValueChanged="EndSlider_ValueChanged" />
                            <Slider x:Name="EndGreenSlider"
                                    Grid.Row="1" Grid.Column="1"
                                    Maximum="255" Minimum="0" Margin="3" 
                                    ValueChanged="EndSlider_ValueChanged"/>
                            <Slider x:Name="EndBlueSlider"
                                    Grid.Row="2" Grid.Column="1"
                                    Maximum="255" Minimum="0" Margin="3" 
                                    ValueChanged="EndSlider_ValueChanged"/>

                            <TextBox x:Name="EndValueTextBox"
                                    Grid.Row="3" Grid.ColumnSpan="2"
                                    Margin="3" VerticalAlignment="Center" 
                                    TextChanged="EndValueTextBox_TextChanged" />
                        </Grid>
                    </GroupBox>

                    <GroupBox Header="Idle Colour"
                              Grid.Row="1">
                        <Grid >
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <Label Content="Red" />
                            <Label Content="Green" Grid.Row="1" />
                            <Label Content="Blue" Grid.Row="2" />

                            <Slider x:Name="StartRedSlider"
                                    Grid.Column="1"
                                    Maximum="255" Minimum="0" Margin="3" 
                                    ValueChanged="StartSlider_ValueChanged" />
                            <Slider x:Name="StartGreenSlider"
                                    Grid.Row="1" Grid.Column="1"
                                    Maximum="255" Minimum="0" Margin="3" 
                                    ValueChanged="StartSlider_ValueChanged" />
                            <Slider x:Name="StartBlueSlider"
                                    Grid.Row="2" Grid.Column="1"
                                    Maximum="255" Minimum="0" Margin="3" 
                                    ValueChanged="StartSlider_ValueChanged"/>

                            <TextBox x:Name="StartValueTextBox" 
                                     Grid.Row="3" Grid.ColumnSpan="2" 
                                     Margin="3" VerticalAlignment="Center" 
                                     TextChanged="StartValueTextBox_TextChanged"/>
                        </Grid>
                    </GroupBox>
                </Grid>
            </TabItem>
            <TabItem Header="Timing">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="157*" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="60" />
                    </Grid.ColumnDefinitions>

                    <Grid.Resources>
                        <Style TargetType="Label">
                            <Setter Property="Padding" Value="3"/>
                            <Setter Property="Margin" Value="3"/>
                        </Style>
                        <Style TargetType="Slider">
                            <Setter Property="Margin" Value="3"/>
                        </Style>
                    </Grid.Resources>

                    <Label>
                        Fade Time
                    </Label>
                    <Label x:Name="FadeTimeLabel" 
                           Grid.Column="2">
                        3secs
                    </Label>
                    <Slider x:Name="FadeTimeSlider"
                            Grid.Column="1"
                            Minimum="0" Maximum="60000"
                            Value="3000"
                            ValueChanged="FadeTimeSlider_ValueChanged" 
                            LargeChange="{Binding Path=TickFrequency, RelativeSource={RelativeSource Self}}"
                            SmallChange="{Binding Path=TickFrequency, RelativeSource={RelativeSource Self}}" 
                            TickFrequency="100" 
                            IsSnapToTickEnabled="True" />

                    <Label Grid.Row="1">
                        Freeze Time
                    </Label>
                    <Label x:Name="FreezeTimeLabel"
                           Grid.Column="2" Grid.Row="1">
                        2secs
                    </Label>
                    <Slider x:Name="FreezeTimeSlider"
                            Grid.Column="1" Grid.Row="1"
                            Minimum="0" Maximum="60000"
                            Value="2000"
                            ValueChanged="FreezeTimeSlider_ValueChanged"
                            LargeChange="{Binding Path=TickFrequency, RelativeSource={RelativeSource Self}}"
                            SmallChange="{Binding Path=TickFrequency, RelativeSource={RelativeSource Self}}" 
                            TickFrequency="100"
                            IsSnapToTickEnabled="True" />

                    <Label Grid.Row="2">
                        Key Press Shift
                    </Label>
                    <Label x:Name="GlowGrowthLabel" 
                           Grid.Column="2" Grid.Row="2">
                        15%
                    </Label>
                    <Slider x:Name="GlowGrowthSlider" 
                            Grid.Column="1" Grid.Row="2" 
                            Minimum="1" Maximum="100" 
                            Value="15"
                            ValueChanged="GlowGrowthSlider_ValueChanged" 
                            SmallChange="1"
                            IsSnapToTickEnabled="True" />
                </Grid>
            </TabItem>
        </TabControl>
    </Grid>
</UserControl>